#include<bits/stdc++.h>
using namespace std;
int n,a[100005],b[100005];
inline int read(){
    int x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9'){
        if(c=='-')
            f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        x=x*10+c-'0';
        c=getchar();
    }
    return x*f;
}
inline void write(int x){
    if(x<0){
        putchar('-');
        x=-x;
    }
    if(x>9){
        write(x/10);
    }
    putchar(x%10+'0');
    return;
}
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    memset(b,0,sizeof(b));
    int x,o=0;
    for(register int i=1;i<=n;++i){
        x=read();
        if(b[x]==0){
            b[x]++;
            a[++o]=x;
            continue;
        }
        b[x]++;
    }
    sort(a+1,a+o+1);
    int ans=n;
    a[o+1]=0;
    a[0]=0;
    int p=b[a[1]];
    for(register int i=2;i<=o;++i){
        x=a[i];
        if(b[x]>p){
            ans-=p;
            p=b[x];
            continue;
        }
        ans-=b[x];
    }
    write(ans);
    putchar('\n');
    return 0;
}
